package psd.model.Prolog.Converters;

import org.eclipse.jdt.core.dom.TryStatement;

import psd.model.IConverter;
import psd.model.Prolog.FactGenerationToolbox;
import psd.model.Prolog.PrologConverter;


public class PrologTryStatementConverter extends PrologConverter implements
		IConverter<TryStatement> {

	public PrologTryStatementConverter(FactGenerationToolbox toolbox) {
		super(toolbox);
	}

	@Override
	public boolean convert(TryStatement node) {
		String args[] = {
				idResolver.getID(node.getBody()),
				idResolver.getIDs(node.catchClauses()),
				node.getFinally() != null ? idResolver.getID(node.getFinally())
						: "'null'" };
		createBodyFact(node, "tryT", args);
		return true;
	}

}
